package netty.http;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * Created with IntelliJ IDEA.
 * User: SuQiEr
 * Date:2017/5/13 0013
 * Time: 下午 10:14
 * To change this template use File | Settings | File Templates.
 */
public class ServiceInit  extends ChannelInitializer<SocketChannel>{

    //初始化
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {

        ChannelPipeline pipeline = socketChannel.pipeline();
        pipeline.addLast(new HttpServerCodec());
        pipeline.addLast(new ServiceHandler());
    }
}
